#include "Metrology.h"
#include "Unit.h"
#include "FormatOutput.h"

Metrology::Metrology(const int& value_i, Unit& unit_i):
    basicValue_m(unit_i.toBaseUnitValue(value_i)),
    unit_m(&unit_i)
{
}


bool Metrology::isEqual(const Metrology& metro1, const Metrology& metro2) const
{
    return (metro1.basicValue_m == metro2.basicValue_m);
}

int Metrology::add(const Metrology& metro1, const Metrology& metro2) const
{
    return (metro1.basicValue_m + metro2.basicValue_m);
}

ostream& Metrology::output(ostream& os_io, FormatOutput* output_i) const
{
    output_i->output(os_io, basicValue_m, unit_m);
    return os_io;
}


